/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('selectdb', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AllocateInstancePublicConnectionRequest {
  connectionStringPrefix?: string(name='ConnectionStringPrefix', description='The prefix of the endpoint. Set the parameter to the prefix of the value of **ConnectionString**.

This parameter is required.', example='selectdb-cn-h033cn****-pub-i3'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  netType?: string(name='NetType', description='The network type of the endpoint to be applied for. Set the value to Public.

This parameter is required.', example='Public'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AllocateInstancePublicConnectionResponseBody = {
  instanceName?: string(name='InstanceName', description='The name of the instance.'),
  requestId?: string(name='RequestId', description='The request ID.', example='5ED62C81-9948-5612-81E1-EA3853752306'),
  taskId?: long(name='TaskId', description='The task ID.', example='498115273'),
}

model AllocateInstancePublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AllocateInstancePublicConnectionResponseBody(name='body'),
}

/**
 * @summary Applies for a public endpoint for an ApsaraDB for SelectDB instance.
 *
 * @param request AllocateInstancePublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AllocateInstancePublicConnectionResponse
 */
async function allocateInstancePublicConnectionWithOptions(request: AllocateInstancePublicConnectionRequest, runtime: Util.RuntimeOptions): AllocateInstancePublicConnectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionStringPrefix)) {
    query['ConnectionStringPrefix'] = request.connectionStringPrefix;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.netType)) {
    query['NetType'] = request.netType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AllocateInstancePublicConnection',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Applies for a public endpoint for an ApsaraDB for SelectDB instance.
 *
 * @param request AllocateInstancePublicConnectionRequest
 * @return AllocateInstancePublicConnectionResponse
 */
async function allocateInstancePublicConnection(request: AllocateInstancePublicConnectionRequest): AllocateInstancePublicConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return allocateInstancePublicConnectionWithOptions(request, runtime);
}

model CheckCreateDBInstanceRequest {
  cacheSize?: int32(name='CacheSize', description='This parameter is required.', example='200'),
  chargeType?: string(name='ChargeType', description='This parameter is required.', example='PrePaid'),
  clientToken?: string(name='ClientToken', example='AB'),
  connectionString?: string(name='ConnectionString', example='selectdb-cn-7213c8y****-public.selectdbfe.pre.rds.aliyuncs.com'),
  DBInstanceClass?: string(name='DBInstanceClass', description='The specifications of the instance. Valid values:

*   **selectdb.xlarge**: 4 CPU cores and 32 GB of memory.
*   **selectdb.2xlarge**: 8 CPU cores and 64 GB of memory.
*   **selectdb.4xlarge**: 16 CPU cores and 128 GB of memory.
*   **selectdb.8xlarge**: 32 CPU cores and 256 GB of memory.
*   **selectdb.16xlarge**: 64 CPU cores and 512 GB of memory.
*   **selectdb.24xlarge**: 96 CPU cores and 768 GB of memory.
*   **selectdb.32xlarge**: 128 CPU cores and 1,024 GB of memory.

This parameter is required.', example='selectdb.xlarge'),
  DBInstanceDescription?: string(name='DBInstanceDescription'),
  engine?: string(name='Engine', description='The database engine of the instance.', example='SelectDB'),
  engineVersion?: string(name='EngineVersion', description='The version of the database engine.

This parameter is required.', example='2.4'),
  period?: string(name='Period', example='Month'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-4690g37929****'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityIPList?: string(name='SecurityIPList', example='172.16.XX.XX/12,192.168.XX.XX/22'),
  usedTime?: int32(name='UsedTime', description='The subscription duration of the instance. Valid values:

*   If Period is set to Year, valid values of UsedTime are 1, 2, 3, 4, and 5.
*   If Period is set to Month, valid values of UsedTime are 1 to 12.

>  This parameter takes effect and is required only if ChargeType is set to Prepaid.', example='1'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-bp1gzt31twhlo0sa5****'),
  vpcId?: string(name='VpcId', description='VPC ID。

This parameter is required.', example='vpc-bp175iuvg8nxqraf2****'),
  zoneId?: string(name='ZoneId', description='This parameter is required.', example='cn-hangzhou-i'),
}

model CheckCreateDBInstanceResponseBody = {
  requestId?: string(name='RequestId', example='ADF42B18-43FD-5100-83A9-BE81AB70C863'),
}

model CheckCreateDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckCreateDBInstanceResponseBody(name='body'),
}

/**
 * @summary SelectDB实例创建前检查
 *
 * @param request CheckCreateDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckCreateDBInstanceResponse
 */
async function checkCreateDBInstanceWithOptions(request: CheckCreateDBInstanceRequest, runtime: Util.RuntimeOptions): CheckCreateDBInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cacheSize)) {
    query['CacheSize'] = request.cacheSize;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionString)) {
    query['ConnectionString'] = request.connectionString;
  }
  if (!Util.isUnset(request.DBInstanceClass)) {
    query['DBInstanceClass'] = request.DBInstanceClass;
  }
  if (!Util.isUnset(request.DBInstanceDescription)) {
    query['DBInstanceDescription'] = request.DBInstanceDescription;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityIPList)) {
    query['SecurityIPList'] = request.securityIPList;
  }
  if (!Util.isUnset(request.usedTime)) {
    query['UsedTime'] = request.usedTime;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckCreateDBInstance',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary SelectDB实例创建前检查
 *
 * @param request CheckCreateDBInstanceRequest
 * @return CheckCreateDBInstanceResponse
 */
async function checkCreateDBInstance(request: CheckCreateDBInstanceRequest): CheckCreateDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkCreateDBInstanceWithOptions(request, runtime);
}

model CheckServiceLinkedRoleRequest {
  ownerAccount?: string(name='OwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CheckServiceLinkedRoleResponseBody = {
  hasServiceLinkedRole?: boolean(name='HasServiceLinkedRole', example='False'),
  requestId?: string(name='RequestId', example='1F455133-981E-5AD0-80EB-26EA1EF3C65F'),
}

model CheckServiceLinkedRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckServiceLinkedRoleResponseBody(name='body'),
}

/**
 * @summary 检查服务关联角色
 *
 * @param request CheckServiceLinkedRoleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckServiceLinkedRoleResponse
 */
async function checkServiceLinkedRoleWithOptions(request: CheckServiceLinkedRoleRequest, runtime: Util.RuntimeOptions): CheckServiceLinkedRoleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckServiceLinkedRole',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 检查服务关联角色
 *
 * @param request CheckServiceLinkedRoleRequest
 * @return CheckServiceLinkedRoleResponse
 */
async function checkServiceLinkedRole(request: CheckServiceLinkedRoleRequest): CheckServiceLinkedRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkServiceLinkedRoleWithOptions(request, runtime);
}

model CreateDBClusterRequest {
  cacheSize?: string(name='CacheSize', description='This parameter is required.', example='200'),
  chargeType?: string(name='ChargeType', description='This parameter is required.', example='Prepaid'),
  DBClusterClass?: string(name='DBClusterClass', description='This parameter is required.', example='selectdb.2xlarge'),
  DBClusterDescription?: string(name='DBClusterDescription', description='This parameter is required.', example='testdb'),
  DBInstanceId?: string(name='DBInstanceId', description='代表资源一级ID的资源属性字段

This parameter is required.', example='selectdb-cn-7213cjv****'),
  engine?: string(name='Engine', description='The database engine of the instance.', example='selectdb'),
  engineVersion?: string(name='EngineVersion', description='This parameter is required.', example='2.4'),
  period?: string(name='Period', example='Month'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  usedTime?: string(name='UsedTime', example='1'),
  vSwitchId?: string(name='VSwitchId', description='This parameter is required.', example='vsw-bp1gzt31twhlo0sa5****'),
  vpcId?: string(name='VpcId', description='VPC ID.

This parameter is required.', example='vpc-bp175iuvg8nxqraf2****'),
  zoneId?: string(name='ZoneId', description='This parameter is required.', example='cn-hangzhou-i'),
}

model CreateDBClusterResponseBody = {
  data?: {
    clusterId?: string(name='ClusterId', example='selectdb-cn-1ls3sg0po0****'),
    DBInstanceId?: string(name='DBInstanceId', example='selectdb-cn-7213cjv****'),
    orderId?: long(name='OrderId', example='219543646290345'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='F8900A96-67F7-5274-A41B-7722E1ECF8C9'),
}

model CreateDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBClusterResponseBody(name='body'),
}

/**
 * @summary Creates a cluster in an ApsaraDB for SelectDB instance.
 *
 * @description > : For an instance that uses the pay-as-you-go billing method, you can create only pay-as-you-go clusters. For an instance that uses the subscription billing method, you can create pay-as-you-go or subscription clusters.
 *
 * @param request CreateDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBClusterResponse
 */
async function createDBClusterWithOptions(request: CreateDBClusterRequest, runtime: Util.RuntimeOptions): CreateDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cacheSize)) {
    query['CacheSize'] = request.cacheSize;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.DBClusterClass)) {
    query['DBClusterClass'] = request.DBClusterClass;
  }
  if (!Util.isUnset(request.DBClusterDescription)) {
    query['DBClusterDescription'] = request.DBClusterDescription;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.usedTime)) {
    query['UsedTime'] = request.usedTime;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    body['DBInstanceId'] = request.DBInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBCluster',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a cluster in an ApsaraDB for SelectDB instance.
 *
 * @description > : For an instance that uses the pay-as-you-go billing method, you can create only pay-as-you-go clusters. For an instance that uses the subscription billing method, you can create pay-as-you-go or subscription clusters.
 *
 * @param request CreateDBClusterRequest
 * @return CreateDBClusterResponse
 */
async function createDBCluster(request: CreateDBClusterRequest): CreateDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBClusterWithOptions(request, runtime);
}

model CreateDBInstanceRequest {
  cacheSize?: int32(name='CacheSize', description='The reserved cache size.

This parameter is required.', example='200GB'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **Postpaid**: pay-as-you-go
*   **Prepaid**: subscription

This parameter is required.', example='PrePaid'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='AB'),
  connectionString?: string(name='ConnectionString', description='The instance endpoint.', example='selectdb-cn-7213c8y****-public.selectdbfe.pre.rds.aliyuncs.com'),
  DBInstanceClass?: string(name='DBInstanceClass', description='The specifications of the instance. Valid values:

*   **selectdb.xlarge**: 4 CPU cores and 32 GB of memory
*   **selectdb.2xlarge**: 8 CPU cores and 64 GB of memory
*   **selectdb.4xlarge**: 16 CPU cores and 128 GB of memory

This parameter is required.', example='selectdb.xlarge'),
  DBInstanceDescription?: string(name='DBInstanceDescription', description='The instance description.', example='The instance is created for testing.'),
  deployScheme?: string(name='DeployScheme'),
  engine?: string(name='Engine', description='The database engine of the instance. Default value: **selectdb**.', example='selectdb'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Default value: **2.4**.

This parameter is required.', example='2.4'),
  multiZone?: [ 
    {
      vSwitchIds?: [ string ](name='VSwitchIds'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='MultiZone', nullable=false),
  period?: string(name='Period', description='The unit of the subscription duration of the cluster. Valid values:

*   **Year**: subscription on a yearly basis.
*   **Month**: subscription on a monthly basis.

>  This parameter takes effect and is required only when **ChargeType** is set to **Prepaid**.', example='Month'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-aekzt2zaluvuvqa_fake'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityIPList?: string(name='SecurityIPList', description='The IP addresses in the whitelist of the instance. Separate multiple IP addresses with commas (,).', example='192.168.1.1'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key.', example='testKey'),
      value?: string(name='Value', description='The tag value.', example='testValue'),
    }
  ](name='Tag', description='The instance tags.'),
  usedTime?: int32(name='UsedTime', description='The subscription duration of the instance.

*   Valid values when Period is set to Year: 1, 2, 3, and 5 (integer)
*   Valid values when Period is set to Month: 1 to 9 (integer)

>  This parameter takes effect and is required only when **ChargeType** is set to **Prepaid**.', example='1'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.

This parameter is required.', example='vsw-bp1gzt31twhlo0sa5****'),
  vpcId?: string(name='VpcId', description='The virtual private cloud (VPC) ID.

This parameter is required.', example='vpc-bp175iuvg8nxqraf2****'),
  zoneId?: string(name='ZoneId', description='The zone ID.

This parameter is required.', example='cn-hangzhou-e'),
}

model CreateDBInstanceShrinkRequest {
  cacheSize?: int32(name='CacheSize', description='The reserved cache size.

This parameter is required.', example='200GB'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **Postpaid**: pay-as-you-go
*   **Prepaid**: subscription

This parameter is required.', example='PrePaid'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.', example='AB'),
  connectionString?: string(name='ConnectionString', description='The instance endpoint.', example='selectdb-cn-7213c8y****-public.selectdbfe.pre.rds.aliyuncs.com'),
  DBInstanceClass?: string(name='DBInstanceClass', description='The specifications of the instance. Valid values:

*   **selectdb.xlarge**: 4 CPU cores and 32 GB of memory
*   **selectdb.2xlarge**: 8 CPU cores and 64 GB of memory
*   **selectdb.4xlarge**: 16 CPU cores and 128 GB of memory

This parameter is required.', example='selectdb.xlarge'),
  DBInstanceDescription?: string(name='DBInstanceDescription', description='The instance description.', example='The instance is created for testing.'),
  deployScheme?: string(name='DeployScheme'),
  engine?: string(name='Engine', description='The database engine of the instance. Default value: **selectdb**.', example='selectdb'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance. Default value: **2.4**.

This parameter is required.', example='2.4'),
  multiZoneShrink?: string(name='MultiZone', nullable=false),
  period?: string(name='Period', description='The unit of the subscription duration of the cluster. Valid values:

*   **Year**: subscription on a yearly basis.
*   **Month**: subscription on a monthly basis.

>  This parameter takes effect and is required only when **ChargeType** is set to **Prepaid**.', example='Month'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-aekzt2zaluvuvqa_fake'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityIPList?: string(name='SecurityIPList', description='The IP addresses in the whitelist of the instance. Separate multiple IP addresses with commas (,).', example='192.168.1.1'),
  tagShrink?: string(name='Tag', description='The instance tags.'),
  usedTime?: int32(name='UsedTime', description='The subscription duration of the instance.

*   Valid values when Period is set to Year: 1, 2, 3, and 5 (integer)
*   Valid values when Period is set to Month: 1 to 9 (integer)

>  This parameter takes effect and is required only when **ChargeType** is set to **Prepaid**.', example='1'),
  vSwitchId?: string(name='VSwitchId', description='The vSwitch ID.

This parameter is required.', example='vsw-bp1gzt31twhlo0sa5****'),
  vpcId?: string(name='VpcId', description='The virtual private cloud (VPC) ID.

This parameter is required.', example='vpc-bp175iuvg8nxqraf2****'),
  zoneId?: string(name='ZoneId', description='The zone ID.

This parameter is required.', example='cn-hangzhou-e'),
}

model CreateDBInstanceResponseBody = {
  data?: {
    DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='selectdb-cn-7213cjv****'),
    orderId?: long(name='OrderId', description='The order ID.', example='21137950671****'),
  }(name='Data', description='The returned result.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4773E4EC-025D-509F-AEA9-D53123FDFB0F'),
}

model CreateDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDBInstanceResponseBody(name='body'),
}

/**
 * @summary Creates an ApsaraDB for SelectDB instance.
 *
 * @param tmpReq CreateDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDBInstanceResponse
 */
async function createDBInstanceWithOptions(tmpReq: CreateDBInstanceRequest, runtime: Util.RuntimeOptions): CreateDBInstanceResponse {
  Util.validateModel(tmpReq);
  var request = new CreateDBInstanceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.multiZone)) {
    request.multiZoneShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.multiZone, 'MultiZone', 'json');
  }
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.cacheSize)) {
    query['CacheSize'] = request.cacheSize;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.connectionString)) {
    query['ConnectionString'] = request.connectionString;
  }
  if (!Util.isUnset(request.DBInstanceClass)) {
    query['DBInstanceClass'] = request.DBInstanceClass;
  }
  if (!Util.isUnset(request.DBInstanceDescription)) {
    query['DBInstanceDescription'] = request.DBInstanceDescription;
  }
  if (!Util.isUnset(request.deployScheme)) {
    query['DeployScheme'] = request.deployScheme;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.multiZoneShrink)) {
    query['MultiZone'] = request.multiZoneShrink;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityIPList)) {
    query['SecurityIPList'] = request.securityIPList;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  if (!Util.isUnset(request.usedTime)) {
    query['UsedTime'] = request.usedTime;
  }
  if (!Util.isUnset(request.vSwitchId)) {
    query['VSwitchId'] = request.vSwitchId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDBInstance',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates an ApsaraDB for SelectDB instance.
 *
 * @param request CreateDBInstanceRequest
 * @return CreateDBInstanceResponse
 */
async function createDBInstance(request: CreateDBInstanceRequest): CreateDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBInstanceWithOptions(request, runtime);
}

model CreateElasticRuleRequest {
  clusterClass?: string(name='ClusterClass', description='The rule for computing resources of the required cluster.

This parameter is required.', example='selectdb.2xlarge'),
  clusterId?: string(name='ClusterId', description='The cluster ID.

This parameter is required.', example='selectdb-xxxb9f2w-be'),
  dbInstanceId?: string(name='DbInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  elasticRuleStartTime?: string(name='ElasticRuleStartTime', description='The time when you want to execute the scheduled scaling rule.

This parameter is required.', example='00:00'),
  executionPeriod?: string(name='ExecutionPeriod', description='The execution cycle.

Valid value:

*   Day

This parameter is required.', example='Day'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateElasticRuleResponseBody = {
  data?: {
    clusterClass?: string(name='ClusterClass', description='The rule for computing resources of the required cluster.', example='selectdb.2xlarge'),
    clusterId?: string(name='ClusterId', description='The cluster ID.', example='selectdb-xxxb9f2w-be'),
    dbInstanceId?: string(name='DbInstanceId', description='The instance ID.', example='selectdb-cn-7213cjv****'),
    elasticRuleStartTime?: string(name='ElasticRuleStartTime', description='The time when the scheduled scaling rule is executed.', example='00:00'),
    executionPeriod?: string(name='ExecutionPeriod', description='The execution cycle.

Valid value:

*   Day', example='Day'),
    ruleId?: long(name='RuleId', description='The rule ID.', example='5465'),
  }(name='Data', description='The data returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F8900A96-67F7-5274-A41B-7722E1ECF8C9'),
}

model CreateElasticRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateElasticRuleResponseBody(name='body'),
}

/**
 * @summary Creates a scheduled scaling rule.
 *
 * @param request CreateElasticRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateElasticRuleResponse
 */
async function createElasticRuleWithOptions(request: CreateElasticRuleRequest, runtime: Util.RuntimeOptions): CreateElasticRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterClass)) {
    query['ClusterClass'] = request.clusterClass;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.dbInstanceId)) {
    query['DbInstanceId'] = request.dbInstanceId;
  }
  if (!Util.isUnset(request.elasticRuleStartTime)) {
    query['ElasticRuleStartTime'] = request.elasticRuleStartTime;
  }
  if (!Util.isUnset(request.executionPeriod)) {
    query['ExecutionPeriod'] = request.executionPeriod;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateElasticRule',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a scheduled scaling rule.
 *
 * @param request CreateElasticRuleRequest
 * @return CreateElasticRuleResponse
 */
async function createElasticRule(request: CreateElasticRuleRequest): CreateElasticRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createElasticRuleWithOptions(request, runtime);
}

model CreateServiceLinkedRoleForSelectDBRequest {
  ownerAccount?: string(name='OwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateServiceLinkedRoleForSelectDBResponseBody = {
  requestId?: string(name='RequestId', example='F203FA74-3041-589F-BE66-E570793A0C91'),
}

model CreateServiceLinkedRoleForSelectDBResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceLinkedRoleForSelectDBResponseBody(name='body'),
}

/**
 * @summary Creates a service-linked role for ApsaraDB for SelectDB.
 *
 * @param request CreateServiceLinkedRoleForSelectDBRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceLinkedRoleForSelectDBResponse
 */
async function createServiceLinkedRoleForSelectDBWithOptions(request: CreateServiceLinkedRoleForSelectDBRequest, runtime: Util.RuntimeOptions): CreateServiceLinkedRoleForSelectDBResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceLinkedRoleForSelectDB',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a service-linked role for ApsaraDB for SelectDB.
 *
 * @param request CreateServiceLinkedRoleForSelectDBRequest
 * @return CreateServiceLinkedRoleForSelectDBResponse
 */
async function createServiceLinkedRoleForSelectDB(request: CreateServiceLinkedRoleForSelectDBRequest): CreateServiceLinkedRoleForSelectDBResponse {
  var runtime = new Util.RuntimeOptions{};
  return createServiceLinkedRoleForSelectDBWithOptions(request, runtime);
}

model DeleteDBClusterRequest {
  DBClusterId?: string(name='DBClusterId', description='This parameter is required.', example='selectdb-xxxb9f2w-be'),
  DBInstanceId?: string(name='DBInstanceId', description='代表资源一级ID的资源属性字段

This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='代表资源组的资源属性字段', example='rg-4690g37929****'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteDBClusterResponseBody = {
  data?: {
    DBInstanceId?: string(name='DBInstanceId', example='selectdb-cn-7213cjv****'),
    orderId?: string(name='OrderId', example='220088764060782'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='F203FA74-3041-589F-BE66-E570793A0C91'),
}

model DeleteDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBClusterResponseBody(name='body'),
}

/**
 * @summary 释放实例下集群
 *
 * @param request DeleteDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBClusterResponse
 */
async function deleteDBClusterWithOptions(request: DeleteDBClusterRequest, runtime: Util.RuntimeOptions): DeleteDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    body['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDBCluster',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 释放实例下集群
 *
 * @param request DeleteDBClusterRequest
 * @return DeleteDBClusterResponse
 */
async function deleteDBCluster(request: DeleteDBClusterRequest): DeleteDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBClusterWithOptions(request, runtime);
}

model DeleteDBInstanceRequest {
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteDBInstanceResponseBody = {
  requestId?: string(name='RequestId', example='BD0D0B17-C145-5B91-BFC2-6791927EE973'),
}

model DeleteDBInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDBInstanceResponseBody(name='body'),
}

/**
 * @summary 删除DB实例
 *
 * @param request DeleteDBInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDBInstanceResponse
 */
async function deleteDBInstanceWithOptions(request: DeleteDBInstanceRequest, runtime: Util.RuntimeOptions): DeleteDBInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    body['DBInstanceId'] = request.DBInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDBInstance',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除DB实例
 *
 * @param request DeleteDBInstanceRequest
 * @return DeleteDBInstanceResponse
 */
async function deleteDBInstance(request: DeleteDBInstanceRequest): DeleteDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBInstanceWithOptions(request, runtime);
}

model DeleteElasticRuleRequest {
  clusterId?: string(name='ClusterId', description='The cluster ID.

This parameter is required.', example='selectdb-xxx302i5-be'),
  dbInstanceId?: string(name='DbInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  product?: string(name='Product', description='The cloud service.', example='selectdb'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hanghzou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ruleId?: long(name='RuleId', description='The rule ID.

This parameter is required.', example='100458'),
}

model DeleteElasticRuleResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4773E4EC-025D-509F-AEA9-D53123FDFB0F'),
  success?: boolean(name='Success', description='Indicates whether the deletion is successful.

Valid values:

*   true
*   false', example='true'),
}

model DeleteElasticRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteElasticRuleResponseBody(name='body'),
}

/**
 * @summary Deletes a scheduled scaling rule.
 *
 * @param request DeleteElasticRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteElasticRuleResponse
 */
async function deleteElasticRuleWithOptions(request: DeleteElasticRuleRequest, runtime: Util.RuntimeOptions): DeleteElasticRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.dbInstanceId)) {
    query['DbInstanceId'] = request.dbInstanceId;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteElasticRule',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a scheduled scaling rule.
 *
 * @param request DeleteElasticRuleRequest
 * @return DeleteElasticRuleResponse
 */
async function deleteElasticRule(request: DeleteElasticRuleRequest): DeleteElasticRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteElasticRuleWithOptions(request, runtime);
}

model DescribeAllDBInstanceClassRequest {
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeAllDBInstanceClassResponseBody = {
  classCodeList?: [ 
    {
      classCode?: string(name='ClassCode', example='selectdb.xlarge'),
      cpuCores?: long(name='CpuCores', example='4'),
      defaultStorageInGB?: long(name='DefaultStorageInGB', example='200'),
      maxStorageInGB?: long(name='MaxStorageInGB', example='2000'),
      memoryInGB?: long(name='MemoryInGB', description='The memory size.', example='32'),
      minStorageInGB?: long(name='MinStorageInGB', example='100'),
      stepStorageInGB?: long(name='StepStorageInGB', example='100'),
    }
  ](name='ClassCodeList', description='The instance specifications.'),
  requestId?: string(name='RequestId', example='4773E4EC-025D-509F-AEA9-D53123FDFB0F'),
}

model DescribeAllDBInstanceClassResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAllDBInstanceClassResponseBody(name='body'),
}

/**
 * @summary Queries the information about all instance specifications.
 *
 * @param request DescribeAllDBInstanceClassRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeAllDBInstanceClassResponse
 */
async function describeAllDBInstanceClassWithOptions(request: DescribeAllDBInstanceClassRequest, runtime: Util.RuntimeOptions): DescribeAllDBInstanceClassResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAllDBInstanceClass',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about all instance specifications.
 *
 * @param request DescribeAllDBInstanceClassRequest
 * @return DescribeAllDBInstanceClassResponse
 */
async function describeAllDBInstanceClass(request: DescribeAllDBInstanceClassRequest): DescribeAllDBInstanceClassResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAllDBInstanceClassWithOptions(request, runtime);
}

model DescribeDBClusterConfigRequest {
  configKey?: string(name='ConfigKey', description='The configuration file to be modified.

*   For a compute cluster, set the value to be.conf.
*   For a frontend (FE) cluster, set the value to fe.conf.

This parameter is required.', example='be.conf'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='selectdb-cn-7213c8yvv09-be'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
}

model DescribeDBClusterConfigResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', description='The details about the access denial. This parameter is returned only if Resource Access Management (RAM) authentication failed.', example='failed'),
  data?: {
    dbClusterId?: string(name='DbClusterId', description='The cluster ID.', example='selectdb-cn-wny3li00g02-be'),
    dbInstanceId?: string(name='DbInstanceId', description='The numeric ID of the instance.', example='6585'),
    dbInstanceName?: string(name='DbInstanceName', description='The instance ID.', example='selectdb-cn-wny3li00g02'),
    params?: [ 
      {
        comment?: string(name='Comment', description='The comments on the parameter.'),
        defaultValue?: string(name='DefaultValue', description='The default value of the parameter.', example='15'),
        isDynamic?: int32(name='IsDynamic', description='Indicates whether the parameter immediately takes effect without requiring a restart.', example='true'),
        isUserModifiable?: int32(name='IsUserModifiable', description='Indicates whether the parameter is modifiable.', example='true'),
        name?: string(name='Name', description='The name of the parameter.', example='doris_scanner_thread_pool_thread_num'),
        optional?: string(name='Optional', description='The value range of the parameter.', example='[0-20000]'),
        paramCategory?: string(name='ParamCategory', description='The category of the parameter.'),
        value?: string(name='Value', description='The current value of the parameter.', example='10'),
      }
    ](name='Params', description='The details about each parameter returned.'),
    taskId?: int32(name='TaskId', description='The task ID.', example='107841167'),
  }(name='Data', description='The information returned.'),
  dynamicCode?: string(name='DynamicCode', description='The dynamic code. This parameter is not returned.', example='0'),
  dynamicMessage?: string(name='DynamicMessage', description='The dynamic message. This parameter is not returned.', example='An error occurred while processing your request.'),
  requestId?: string(name='RequestId', description='The request ID.', example='ADF42B18-43FD-5100-83A9-BE81AB70C863'),
}

model DescribeDBClusterConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterConfigResponseBody(name='body'),
}

/**
 * @summary Queries the configuration information about a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeDBClusterConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterConfigResponse
 */
async function describeDBClusterConfigWithOptions(request: DescribeDBClusterConfigRequest, runtime: Util.RuntimeOptions): DescribeDBClusterConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configKey)) {
    query['ConfigKey'] = request.configKey;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterConfig',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the configuration information about a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeDBClusterConfigRequest
 * @return DescribeDBClusterConfigResponse
 */
async function describeDBClusterConfig(request: DescribeDBClusterConfigRequest): DescribeDBClusterConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterConfigWithOptions(request, runtime);
}

model DescribeDBClusterConfigChangeLogsRequest {
  configKey?: string(name='ConfigKey', description='The configuration file that you want to modify. For a compute cluster, set the value to be.conf. For a frontend (FE) cluster, set the value to fe.conf.', example='be.conf'),
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='selectdb-cn-7213c8yvv09-be'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-jia3ma3b003'),
  endTime?: string(name='EndTime', description='The end of the time range to query. Format: yyyy-MM-dd HH:mm:ss.

This parameter is required.', example='2023-05-08T15:59:59Z'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  startTime?: string(name='StartTime', description='The beginning of the time range to query. Format: yyyy-MM-dd HH:mm:ss.

This parameter is required.', example='2023-04-25T09:48:23Z'),
}

model DescribeDBClusterConfigChangeLogsResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='failed'),
  data?: {
    dbClusterId?: string(name='DbClusterId', description='The cluster ID.', example='selectdb-cn-wny3li00g02-be'),
    dbInstanceId?: string(name='DbInstanceId', example='6585'),
    dbInstanceName?: string(name='DbInstanceName', description='The instance ID.', example='selectdb-cn-wny3li00g02'),
    paramChangeLogs?: [ 
      {
        gmtCreated?: string(name='GmtCreated', example='2022-10-11T08:53:32Z'),
        gmtModified?: string(name='GmtModified', example='2024-03-08T10:08Z'),
        id?: long(name='Id', description='The ID of the change log.', example='617975'),
        isApplied?: boolean(name='IsApplied', description='Indicates whether the modification has taken effect.', example='false'),
        name?: string(name='Name', description='The parameter name.', example='cumulative_compaction_rounds_for_each_base_compaction_round'),
        newValue?: string(name='NewValue', example='12'),
        oldValue?: string(name='OldValue', example='10'),
      }
    ](name='ParamChangeLogs', description='The parameter change logs.'),
    taskId?: int32(name='TaskId', description='The task ID.', example='107841167'),
  }(name='Data', description='The information returned.'),
  dynamicCode?: string(name='DynamicCode', description='The dynamic code. This parameter is not returned.', example='0'),
  dynamicMessage?: string(name='DynamicMessage', description='The dynamic message. This parameter is not returned.', example='An error occurred while processing your request.'),
  requestId?: string(name='RequestId', example='F8900A96-67F7-5274-A41B-7722E1ECF8C9'),
}

model DescribeDBClusterConfigChangeLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBClusterConfigChangeLogsResponseBody(name='body'),
}

/**
 * @summary Queries the configuration change logs of a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeDBClusterConfigChangeLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBClusterConfigChangeLogsResponse
 */
async function describeDBClusterConfigChangeLogsWithOptions(request: DescribeDBClusterConfigChangeLogsRequest, runtime: Util.RuntimeOptions): DescribeDBClusterConfigChangeLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configKey)) {
    query['ConfigKey'] = request.configKey;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBClusterConfigChangeLogs',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the configuration change logs of a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeDBClusterConfigChangeLogsRequest
 * @return DescribeDBClusterConfigChangeLogsResponse
 */
async function describeDBClusterConfigChangeLogs(request: DescribeDBClusterConfigChangeLogsRequest): DescribeDBClusterConfigChangeLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBClusterConfigChangeLogsWithOptions(request, runtime);
}

model DescribeDBInstanceAttributeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBInstanceAttributeResponseBody = {
  canUpgradeVersions?: [ string ](name='CanUpgradeVersions', description='The information returned.'),
  chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.', example='Prepaid'),
  createTime?: string(name='CreateTime', description='The time when the instance was created.', example='2023-08-14T03:00:42Z'),
  DBClusterList?: [ 
    {
      cacheStorageSizeGB?: string(name='CacheStorageSizeGB', description='The cache size. Unit: GB.', example='200'),
      cacheStorageType?: string(name='CacheStorageType', description='The cache type.', example='cloud_essd'),
      chargeType?: string(name='ChargeType', description='The billing method of the cluster. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.', example='Prepaid'),
      clusterBinding?: string(name='ClusterBinding'),
      cpuCores?: long(name='CpuCores', description='The number of CPU cores.', example='8'),
      createdTime?: string(name='CreatedTime', description='The time when the cluster was created.', example='2023-08-14T09:24:13Z'),
      dbClusterClass?: string(name='DbClusterClass', description='The specifications of the cluster. Valid values:

*   **selectdb.xlarge**: 4 CPU cores and 32 GB of memory.
*   **selectdb.2xlarge**: 8 CPU cores and 64 GB of memory.
*   **selectdb.4xlarge**: 16 CPU cores and 128 GB of memory.
*   **selectdb.8xlarge**: 32 CPU cores and 256 GB of memory.
*   **selectdb.16xlarge**: 64 CPU cores and 512 GB of memory.
*   **selectdb.24xlarge**: 96 CPU cores and 768 GB of memory.
*   **selectdb.32xlarge**: 128 CPU cores and 1,024 GB of memory.', example='selectdb.2xlarge'),
      dbClusterId?: string(name='DbClusterId', description='The ID of the cluster.', example='selectdb-cn-h033cjs****-be'),
      dbClusterName?: string(name='DbClusterName', description='The name of the cluster.', example='test01'),
      dbInstanceName?: string(name='DbInstanceName', description='The instance name.', example='test instance'),
      memory?: long(name='Memory', description='The memory size.', example='64'),
      modifiedTime?: string(name='ModifiedTime', description='The modified time.', example='2024-07-02T16:35:44+08:00'),
      performanceLevel?: string(name='PerformanceLevel', description='The performance level.', example='PL1'),
      scalingRulesEnable?: boolean(name='ScalingRulesEnable'),
      startTime?: string(name='StartTime', description='The time when the cluster started.', example='2023-08-14T09:24:13Z'),
      status?: string(name='Status', description='The state of the cluster. Valid values:

*   **CREATING**: The cluster is being created.
*   **ACTIVATION**: The cluster is running.
*   **RESOURCE_CHANGING**: The resource configuration of the cluster is being changed.
*   **ORDER_PREPARING**: The order is being confirmed.
*   **READONLY_RESOURCE_CHANGING**: The resource configuration of the cluster is being changed and the cluster is write-locked.
*   **DELETING**: The cluster is being deleted.', example='ACTIVATION'),
      subDomain?: string(name='SubDomain'),
      vSwitchId?: string(name='VSwitchId'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='DBClusterList', description='The information about each cluster returned.'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='selectdb-cn-7213cjv****'),
  deployScheme?: string(name='DeployScheme'),
  description?: string(name='Description', description='The description of the instance.', example='test'),
  engine?: string(name='Engine', description='The database engine of the instance.', example='selectdb'),
  engineMinorVersion?: string(name='EngineMinorVersion', description='The minor kernel version number of the instance.', example='3.0.1'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.', example='2.4'),
  expireTime?: string(name='ExpireTime', description='The time when the instance expires.', example='2023-09-17T00:00Z'),
  gmtModified?: string(name='GmtModified', description='The time when the instance was last modified, such as when you restarted the instance or applied for a public endpoint for the instance. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.', example='2023-08-17T09:58Z'),
  lockMode?: long(name='LockMode', description='The lock mode of the instance. Set the value to **lock**, which specifies that the instance is locked when it automatically expires or has an overdue payment.', example='lock'),
  lockReason?: string(name='LockReason', description='The reason why the instance is locked.', example='nolock'),
  maintainEndtime?: string(name='MaintainEndtime', description='The end time of the instance maintenance window.', example='1970-01-01T05:00Z'),
  maintainStarttime?: string(name='MaintainStarttime', description='The start time of the instance maintenance window.', example='1970-01-01T02:00Z'),
  multiZone?: [ 
    {
      availableIpCount?: long(name='AvailableIpCount'),
      cidr?: string(name='Cidr'),
      vSwitchIds?: [ string ](name='VSwitchIds'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='MultiZone', nullable=true),
  objectStoreSize?: long(name='ObjectStoreSize', description='The storage capacity of the instance.', example='0'),
  regionId?: string(name='RegionId', description='The Region ID.', example='cn-beijing'),
  requestId?: string(name='RequestId', description='The request ID.', example='06758CAB-1204-5852-A471-29C87D5C1D0F'),
  resourceCpu?: long(name='ResourceCpu', description='The number of CPU cores of the instance.', example='8'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-aekzbck4asz3dsa'),
  status?: string(name='Status', description='The state of the instance. Valid values:

*   **CREATING**: The instance is being created.
*   **ACTIVATION**: The instance is running.
*   **RESOURCE_CHANGING**: The resource configuration of the instance is being changed.
*   **ORDER_PREPARING**: The order is being confirmed.
*   **READONLY_RESOURCE_CHANGING**: The resource configuration of the instance is being changed and the instance is write-locked.
*   **DELETING**: The instance is being deleted.', example='ACTIVATION'),
  storageSize?: long(name='StorageSize', description='The cache size.', example='400'),
  subDomain?: string(name='SubDomain', description='The subdomain zone ID.', example='cn-beijing-h-aliyun'),
  tags?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='testKey'),
      tagValue?: string(name='TagValue', description='The tag value.', example='testValue'),
    }
  ](name='Tags', description='The tags that are added to the instances. Each tag is a key-value pair that consists of two parts: TagKey and TagValue. Format: `{"key1":"value1"}`.'),
  vSwitchId?: string(name='VSwitchId'),
  vpcId?: string(name='VpcId', description='The VPC ID.', example='vpc-bp175iuvg8nxqraf2****'),
  zoneId?: string(name='ZoneId', description='The Zone ID.', example='cn-beijing-h'),
}

model DescribeDBInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details about an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeDBInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceAttributeResponse
 */
async function describeDBInstanceAttributeWithOptions(request: DescribeDBInstanceAttributeRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstanceAttribute',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details about an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeDBInstanceAttributeRequest
 * @return DescribeDBInstanceAttributeResponse
 */
async function describeDBInstanceAttribute(request: DescribeDBInstanceAttributeRequest): DescribeDBInstanceAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceAttributeWithOptions(request, runtime);
}

model DescribeDBInstanceNetInfoRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBInstanceNetInfoResponseBody = {
  DBClustersNetInfos?: [ 
    {
      clusterId?: string(name='ClusterId', description='The cluster ID.', example='selectdb-cn-****-be'),
      connectionString?: string(name='ConnectionString', description='The connection string of the BE cluster.', example='selectdb-cn-****-fe.selectdbfe.pre.rds.aliyuncs.com'),
      ip?: string(name='Ip', description='The IP address of the BE cluster.', example='8.131.***.***'),
      netType?: string(name='NetType', description='The network type of the BE cluster.', example='VPC/PUBLIC'),
      portList?: [ 
        {
          port?: int32(name='Port', description='The port that is used to connect to the BE cluster.', example='MySQLPort/HttpPort'),
          protocol?: string(name='Protocol', description='The protocol of the port.', example='9030/8080'),
        }
      ](name='PortList'),
      userVisible?: boolean(name='UserVisible', description='Indicates whether the network information is visible to users.', example='true/false'),
      vpcId?: string(name='VpcId', description='VPC ID', example='vpc-****'),
      vpcInstanceId?: string(name='VpcInstanceId', description='The VPC ID.', example='selectdb-cn-****-fe-20230816101006'),
      vswitchId?: string(name='VswitchId', description='The vSwitch ID.', example='vsw-****'),
    }
  ](name='DBClustersNetInfos', description='The network information about the backend (BE) clusters.'),
  DBInstanceNetInfos?: [ 
    {
      clusterId?: string(name='ClusterId', description='The cluster ID.', example='selectdb-cn-****-be'),
      connectionString?: string(name='ConnectionString', description='The connection string of the instance.', example='selectdb-cn-h033cnd****-fe.selectdbfe.pre.rds.aliyuncs.com'),
      ip?: string(name='Ip', description='The IP address of the instance.', example='172.16.XX.XX'),
      netType?: string(name='NetType', description='The network type of the instance. Valid values:

*   **VPC**: indicates a virtual private cloud (VPC)-connected instance.
*   **PUBLIC**: indicates an Internet-connected instance.', example='VPC'),
      portList?: [ 
        {
          port?: int32(name='Port', description='The port that is used to connect to the instance.', example='MySQLPort'),
          protocol?: string(name='Protocol', description='The protocol of the port. Valid values:

*   **HttpPort**: HTTP port.
*   **MySQLPort**: MySQL port.', example='9030'),
        }
      ](name='PortList', description='The ports.'),
      userVisible?: boolean(name='UserVisible', description='Indicates whether the network information is visible to users. Valid values:

*   **true**
*   **false**', example='true'),
      vpcId?: string(name='VpcId', description='The VPC ID.', example='vpc-wz90scxq6ods388ft****'),
      vpcInstanceId?: string(name='VpcInstanceId', description='The ID of the VPC-connected instance.', example='selectdb-cn-h033cnd****-fe-20230816101006'),
      vswitchId?: string(name='VswitchId', description='The vSwitch ID.', example='vsw-uf6mlqti065rer6m0****'),
    }
  ](name='DBInstanceNetInfos', description='The network information about the instance.'),
  requestId?: string(name='RequestId', description='The request ID.', example='ADF42B18-43FD-5100-83A9-BE81AB70C863'),
}

model DescribeDBInstanceNetInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstanceNetInfoResponseBody(name='body'),
}

/**
 * @summary Queries the network information about an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeDBInstanceNetInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstanceNetInfoResponse
 */
async function describeDBInstanceNetInfoWithOptions(request: DescribeDBInstanceNetInfoRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceNetInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstanceNetInfo',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the network information about an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeDBInstanceNetInfoRequest
 * @return DescribeDBInstanceNetInfoResponse
 */
async function describeDBInstanceNetInfo(request: DescribeDBInstanceNetInfoRequest): DescribeDBInstanceNetInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceNetInfoWithOptions(request, runtime);
}

model DescribeDBInstancesRequest {
  DBInstanceDescription?: string(name='DBInstanceDescription', description='The description of the instance.'),
  DBInstanceIds?: string(name='DBInstanceIds', description='The instance ID. Separate multiple instance IDs with commas (,).', example='selectdb-cn-7213cjv****'),
  DBInstanceStatus?: string(name='DBInstanceStatus', description='The state of the instance. Valid values:

*   **CREATING**: The instance is being created.
*   **ACTIVATION**: The instance is running.
*   **RESOURCE_CHANGING**: The resource configuration of the instance is being changed.
*   **ORDER_PREPARING**: The order is being confirmed.
*   **READONLY_RESOURCE_CHANGING**: The resource configuration of the instance is being changed and the instance is write-locked.
*   **DELETING**: The instance is being deleted.', example='ACTIVATION'),
  pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tag?: [ 
    {
      key?: string(name='Key', example='testKey'),
      value?: string(name='Value', example='testValue'),
    }
  ](name='Tag'),
}

model DescribeDBInstancesShrinkRequest {
  DBInstanceDescription?: string(name='DBInstanceDescription', description='The description of the instance.'),
  DBInstanceIds?: string(name='DBInstanceIds', description='The instance ID. Separate multiple instance IDs with commas (,).', example='selectdb-cn-7213cjv****'),
  DBInstanceStatus?: string(name='DBInstanceStatus', description='The state of the instance. Valid values:

*   **CREATING**: The instance is being created.
*   **ACTIVATION**: The instance is running.
*   **RESOURCE_CHANGING**: The resource configuration of the instance is being changed.
*   **ORDER_PREPARING**: The order is being confirmed.
*   **READONLY_RESOURCE_CHANGING**: The resource configuration of the instance is being changed and the instance is write-locked.
*   **DELETING**: The instance is being deleted.', example='ACTIVATION'),
  pageNumber?: long(name='PageNumber', description='The page number.', example='1'),
  pageSize?: long(name='PageSize', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagShrink?: string(name='Tag'),
}

model DescribeDBInstancesResponseBody = {
  items?: [ 
    {
      category?: string(name='Category', description='The edition of the instance. Default value: basic.', example='basic'),
      chargeType?: string(name='ChargeType', description='The billing method of the instance. Valid values:

*   **Postpaid**: pay-as-you-go.
*   **Prepaid**: subscription.', example='PrePaid'),
      clusterCount?: int32(name='ClusterCount', description='The total number of clusters.', example='1'),
      DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='selectdb-cn-7213cjv****'),
      deployScheme?: string(name='DeployScheme'),
      description?: string(name='Description', description='The description of the instance.'),
      engine?: string(name='Engine', description='The database engine of the instance.', example='selectdb'),
      engineMinorVersion?: string(name='EngineMinorVersion'),
      engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.', example='2.4'),
      expireTime?: string(name='ExpireTime', description='The time when the cluster expires.

>  A specific value is returned only for subscription clusters whose billing method is **Prepaid**. For pay-as-you-go clusters whose billing method is **Postpaid**, no value is returned.', example='2024-03-29T03:47:05Z'),
      gmtCreated?: string(name='GmtCreated', description='The time when the task was created. The time is displayed in UTC.', example='2023-08-12T04:14Z'),
      gmtModified?: string(name='GmtModified', description='The time when the task was last modified. The time is displayed in UTC.', example='2023-08-12T19:05Z'),
      instanceUsedType?: string(name='InstanceUsedType', description='The type of the instance.', example='Instance'),
      isDeleted?: boolean(name='IsDeleted', description='Indicates whether the instance is deleted. Valid values:

*   **true**
*   **false**', example='false'),
      lockMode?: long(name='LockMode', description='The lock mode of the instance.', example='0'),
      lockReason?: string(name='LockReason', description='The reason why the instance is locked.', example='nolock'),
      maintainEndTimeStr?: string(name='MaintainEndTimeStr', description='The end timestamp of the maintenance window.'),
      maintainEndtime?: string(name='MaintainEndtime', description='The end time of the instance maintenance window.'),
      maintainStartTimeStr?: string(name='MaintainStartTimeStr', description='The start timestamp of the maintenance window.'),
      maintainStarttime?: string(name='MaintainStarttime', description='The start time of the instance maintenance window.'),
      multiZone?: [ 
        {
          vSwitchIds?: [ string ](name='VSwitchIds'),
          zoneId?: string(name='ZoneId'),
        }
      ](name='MultiZone'),
      objectStoreSize?: long(name='ObjectStoreSize', description='The storage capacity of the instance. Unit: GB.', example='200'),
      parentInstance?: string(name='ParentInstance', description='The time when the instance was created.'),
      regionId?: string(name='RegionId', description='The region ID.', example='cn-hangzhou'),
      resourceCpu?: long(name='ResourceCpu', description='The number of CPU cores of the instance.', example='8'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.'),
      resourceMemory?: long(name='ResourceMemory', description='The memory capacity of the instance.', example='64'),
      scaleMax?: long(name='ScaleMax', description='The maximum number of RCUs.', example='0'),
      scaleMin?: long(name='ScaleMin', description='The minimum number of RDS capacity units (RCUs).', example='0'),
      scaleReplica?: long(name='ScaleReplica', description='This parameter is not returned.'),
      status?: string(name='Status', description='The state of the instance. Valid values:

*   **CREATING**: The instance is being created.
*   **ACTIVATION**: The instance is running.
*   **RESOURCE_CHANGING**: The resource configuration of the instance is being changed.
*   **ORDER_PREPARING**: The order is being confirmed.
*   **READONLY_RESOURCE_CHANGING**: The resource configuration of the instance is being changed and the instance is write-locked.
*   **DELETING**: The instance is being deleted.', example='ACTIVATION'),
      storageSize?: long(name='StorageSize', description='The cache size.', example='100'),
      storageType?: string(name='StorageType', description='The storage type of the instance.', example='cloud_essd'),
      tags?: [ 
        {
          tagKey?: string(name='TagKey', example='testKey'),
          tagValue?: string(name='TagValue', example='testValue'),
        }
      ](name='Tags', description='The details about each tag returned.'),
      tenantClusterId?: string(name='TenantClusterId', description='The ID of the cluster that is monitored by Managed Service for Prometheus.'),
      tenantToken?: string(name='TenantToken', description='The token that is used to access Managed Service for Prometheus.'),
      tenantUserId?: string(name='TenantUserId', description='The ID of the account that uses Managed Service for Prometheus.'),
      vpcId?: string(name='VpcId', description='The virtual private cloud (VPC) ID.', example='vpc-bp175iuvg8nxqraf2****'),
      vswitchId?: string(name='VswitchId', description='The vSwitch ID.', example='vsw-bp1gzt31twhlo0sa5****'),
      zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-i'),
      connectionString?: string(name='connectionString', description='The connection string of the instance.'),
    }
  ](name='Items', description='The details about each instance returned.'),
  pageNumber?: long(name='PageNumber', description='The number of entries per page. Valid values:

*   **30** (default)
*   **50**
*   **100**', example='30'),
  pageSize?: long(name='PageSize', description='The page number.', example='1'),
  requestId?: string(name='RequestId', description='The request ID.', example='BC854513-E85E-54F3-9842-B9CCD3308CDD'),
  totalRecordCount?: long(name='TotalRecordCount', description='The total number of entries returned.', example='2'),
}

model DescribeDBInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDBInstancesResponseBody(name='body'),
}

/**
 * @summary Queries the information about ApsaraDB for SelectDB instances.
 *
 * @param tmpReq DescribeDBInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDBInstancesResponse
 */
async function describeDBInstancesWithOptions(tmpReq: DescribeDBInstancesRequest, runtime: Util.RuntimeOptions): DescribeDBInstancesResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeDBInstancesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.DBInstanceDescription)) {
    query['DBInstanceDescription'] = request.DBInstanceDescription;
  }
  if (!Util.isUnset(request.DBInstanceIds)) {
    query['DBInstanceIds'] = request.DBInstanceIds;
  }
  if (!Util.isUnset(request.DBInstanceStatus)) {
    query['DBInstanceStatus'] = request.DBInstanceStatus;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDBInstances',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the information about ApsaraDB for SelectDB instances.
 *
 * @param request DescribeDBInstancesRequest
 * @return DescribeDBInstancesResponse
 */
async function describeDBInstances(request: DescribeDBInstancesRequest): DescribeDBInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstancesWithOptions(request, runtime);
}

model DescribeElasticRulesRequest {
  clusterId?: string(name='ClusterId', description='The cluster ID.

This parameter is required.', example='selectdb-cn-nwy3jv1oa02-be'),
  dbInstanceId?: string(name='DbInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  product?: string(name='Product', description='The cloud service.', example='selectdb'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeElasticRulesResponseBody = {
  data?: {
    clusterId?: string(name='ClusterId', description='The cluster ID.', example='selectdb-cn-nwy3jv1oa02-be'),
    dbInstanceId?: string(name='DbInstanceId', description='The instance ID.', example='selectdb-cn-7213cjv****'),
    rules?: [ 
      {
        clusterClass?: string(name='ClusterClass', description='The rule for computing resources of the required cluster.', example='selectdb.2xlarge'),
        elasticRuleStartTime?: string(name='ElasticRuleStartTime', description='The time when you want to execute the scheduled scaling rule.', example='00:00'),
        executionPeriod?: string(name='ExecutionPeriod', description='The execution cycle.

Valid value:

*   Day', example='Day'),
        ruleId?: long(name='RuleId', description='The rule ID.', example='5467'),
      }
    ](name='Rules', description='The details of the rules.'),
  }(name='Data', description='The data returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F8900A96-67F7-5274-A41B-7722E1ECF8C9'),
}

model DescribeElasticRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeElasticRulesResponseBody(name='body'),
}

/**
 * @summary Queries scheduled scaling rules.
 *
 * @param request DescribeElasticRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeElasticRulesResponse
 */
async function describeElasticRulesWithOptions(request: DescribeElasticRulesRequest, runtime: Util.RuntimeOptions): DescribeElasticRulesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeElasticRules',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries scheduled scaling rules.
 *
 * @param request DescribeElasticRulesRequest
 * @return DescribeElasticRulesResponse
 */
async function describeElasticRules(request: DescribeElasticRulesRequest): DescribeElasticRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeElasticRulesWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  region?: string(name='Region', description='The region ID.', example='cn-beijing'),
  zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-beijing-h'),
}

model DescribeRegionsResponseBody = {
  regionModelList?: [ 
    {
      regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
      zones?: [ 
        {
          description?: string(name='Description', description='The zone description.'),
          disabled?: boolean(name='Disabled', description='Indicates whether the VPC is disabled.', example='false'),
          label?: string(name='Label', description='The label.', example='test'),
          name?: string(name='Name', description='The zone name.'),
          regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
          subDomain?: string(name='SubDomain', description='The subdomain.', example='cn-beijing-h-aliyun'),
          vpcEnabled?: boolean(name='VpcEnabled', description='Indicates whether the VPC is enabled.', example='true'),
          zoneId?: string(name='ZoneId', description='Indicates whether the virtual private cloud (VPC) is available.', example='cn-beijing-h'),
        }
      ](name='Zones', description='An array of zones.'),
    }
  ](name='RegionModelList', description='An array of regions.'),
  requestId?: string(name='RequestId', description='The request ID.', example='F8900A96-67F7-5274-A41B-7722E1ECF8C9'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries available regions and zones.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries available regions and zones.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeSecurityIPListRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeSecurityIPListResponseBody = {
  DBInstanceName?: string(name='DBInstanceName', description='The instance ID.', example='selectdb-cn-7213cjv****'),
  groupItems?: [ 
    {
      aecurityIPType?: string(name='AecurityIPType', description='The IP address type. Valid values:

*   ipv4
*   ipv6 (not supported)', example='ipv4'),
      groupName?: string(name='GroupName', description='The name of the whitelist.', example='group1'),
      groupTag?: string(name='GroupTag', description='The tag of the whitelist.', example='""'),
      securityIPList?: string(name='SecurityIPList', description='The IP addresses in the whitelist. Multiple IP addresses are separated by commas (,).', example='127.0.XX.XX'),
      whitelistNetType?: string(name='WhitelistNetType', description='The network type of the whitelist.', example='mix'),
    }
  ](name='GroupItems', description='The details about each IP address whitelist returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='5CBE044D-4594-525D-AC65-E988553D853E'),
}

model DescribeSecurityIPListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSecurityIPListResponseBody(name='body'),
}

/**
 * @summary Queries the IP addresses in the whitelists of an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeSecurityIPListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSecurityIPListResponse
 */
async function describeSecurityIPListWithOptions(request: DescribeSecurityIPListRequest, runtime: Util.RuntimeOptions): DescribeSecurityIPListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSecurityIPList',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the IP addresses in the whitelists of an ApsaraDB for SelectDB instance.
 *
 * @param request DescribeSecurityIPListRequest
 * @return DescribeSecurityIPListResponse
 */
async function describeSecurityIPList(request: DescribeSecurityIPListRequest): DescribeSecurityIPListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSecurityIPListWithOptions(request, runtime);
}

model EnDisableScalingRulesRequest {
  clusterId?: string(name='ClusterId', description='The cluster ID.

This parameter is required.', example='selectdb-cn-nwy3jv1oa02-be'),
  dbInstanceId?: string(name='DbInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  product?: string(name='Product', description='The cloud service.', example='selectdb'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  scalingRulesEnable?: boolean(name='ScalingRulesEnable', description='Specifies whether to enable the scheduled scaling policy.

Valid values:

*   true
*   false

This parameter is required.', example='true'),
}

model EnDisableScalingRulesResponseBody = {
  data?: {
    clusterId?: string(name='ClusterId', description='The cluster ID.', example='selectdb-cn-pe33jc1nd01-be'),
    dbInstanceId?: string(name='DbInstanceId', description='The instance ID.', example='selectdb-cn-7213cjv****'),
    scalingRulesEnable?: boolean(name='ScalingRulesEnable', description='Indicates whether the scheduled scaling policy is enabled.

Valid values:

*   true
*   false', example='true'),
  }(name='Data', description='The data returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='4773E4EC-025D-509F-AEA9-D53123FDFB0F'),
}

model EnDisableScalingRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnDisableScalingRulesResponseBody(name='body'),
}

/**
 * @summary Uses the scheduled scaling policy.
 *
 * @param request EnDisableScalingRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnDisableScalingRulesResponse
 */
async function enDisableScalingRulesWithOptions(request: EnDisableScalingRulesRequest, runtime: Util.RuntimeOptions): EnDisableScalingRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.dbInstanceId)) {
    query['DbInstanceId'] = request.dbInstanceId;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.scalingRulesEnable)) {
    query['ScalingRulesEnable'] = request.scalingRulesEnable;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnDisableScalingRules',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Uses the scheduled scaling policy.
 *
 * @param request EnDisableScalingRulesRequest
 * @return EnDisableScalingRulesResponse
 */
async function enDisableScalingRules(request: EnDisableScalingRulesRequest): EnDisableScalingRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return enDisableScalingRulesWithOptions(request, runtime);
}

model GetCreateBEClusterInquiryRequest {
  cacheSize?: long(name='CacheSize', description='The size of the elastic cache.', example='200'),
  chargeType?: string(name='ChargeType', description='The billing method.

Valid values:

*   PREPAY: subscription
*   POSTPAY: pay-as-you-go

This parameter is required.', example='POSTPAY'),
  commodityCode?: string(name='CommodityCode', description='The commodity code.

Valid values:

*   selectdb_pre_public_intl: subscription commodity on the international site (alibabacloud.com)
*   selectdb_go_public_cn: pay-as-you-go commodity on the China site (aliyun.com)
*   selectdb_go_public_intl: pay-as-you-go commodity on the international site (alibabacloud.com)
*   selectdb_pre_public_cn: subscription commodity on the China site (aliyun.com).', example='selectdb_go_public_cn'),
  computeSize?: long(name='ComputeSize', description='The number of elastic CPU cores.', example='4'),
  dbInstanceId?: string(name='DbInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-xxx'),
  preCacheSize?: long(name='PreCacheSize', description='The size of the reserved cache.', example='200'),
  preComputeSize?: long(name='PreComputeSize', description='The number of reserved CPU cores.', example='4'),
  pricingCycle?: string(name='PricingCycle', description='The billing cycle.

Valid values:

*   Month
*   Year
*   Minute
*   Hour
*   Day

This parameter is required.', example='Hour'),
  quantity?: long(name='Quantity', description='The number of clusters to be created.

This parameter is required.', example='1'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-beijing'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetCreateBEClusterInquiryResponseBody = {
  data?: {
    currency?: string(name='Currency', description='The currency.', example='CNY'),
    tradeAmount?: string(name='TradeAmount', description='The amount of money.', example='1.76'),
  }(name='Data', description='The information returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='06758CAB-1204-5852-A471-29C87D5C1D0F'),
}

model GetCreateBEClusterInquiryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCreateBEClusterInquiryResponseBody(name='body'),
}

/**
 * @summary Queries the pricing for creating a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request GetCreateBEClusterInquiryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCreateBEClusterInquiryResponse
 */
async function getCreateBEClusterInquiryWithOptions(request: GetCreateBEClusterInquiryRequest, runtime: Util.RuntimeOptions): GetCreateBEClusterInquiryResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCreateBEClusterInquiry',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the pricing for creating a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request GetCreateBEClusterInquiryRequest
 * @return GetCreateBEClusterInquiryResponse
 */
async function getCreateBEClusterInquiry(request: GetCreateBEClusterInquiryRequest): GetCreateBEClusterInquiryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCreateBEClusterInquiryWithOptions(request, runtime);
}

model GetModifyBEClusterInquiryRequest {
  cacheSize?: long(name='CacheSize', description='The size of the elastic cache.', example='200'),
  chargeType?: string(name='ChargeType', description='The billing method.

Valid values:

*   PREPAY: subscription
*   POSTPAY: pay-as-you-go

This parameter is required.', example='POSTPAY'),
  clusterId?: string(name='ClusterId', description='The cluster ID.', example='selectdb-xxx-be'),
  commodityCode?: string(name='CommodityCode', description='The commodity code.

Valid values:

*   selectdb_pre_public_intl: subscription commodity on the international site (alibabacloud.com)
*   selectdb_go_public_cn: pay-as-you-go commodity on the China site (aliyun.com)
*   selectdb_go_public_intl: pay-as-you-go commodity on the international site (alibabacloud.com)
*   selectdb_pre_public_cn: subscription commodity on the China site (aliyun.com).

This parameter is required.', example='selectdb_go_public_cn'),
  computeSize?: long(name='ComputeSize', description='The number of elastic CPU cores.', example='4'),
  dbInstanceId?: string(name='DbInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-xxx'),
  preCacheSize?: long(name='PreCacheSize', description='The size of the reserved cache.', example='200'),
  preComputeSize?: long(name='PreComputeSize', description='The number of reserved CPU cores.', example='4'),
  pricingCycle?: string(name='PricingCycle', description='The billing cycle.

Valid values:

*   Month
*   Year
*   Minute
*   Hour
*   Day

This parameter is required.', example='Hour'),
  quantity?: long(name='Quantity', description='The number of clusters whose specifications are to be changed.

This parameter is required.', example='1'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-beijing'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetModifyBEClusterInquiryResponseBody = {
  data?: {
    currency?: string(name='Currency', description='The currency.', example='CNY'),
    tradeAmount?: string(name='TradeAmount', description='The amount of money.', example='1.76'),
  }(name='Data', description='The information returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='06758CAB-1204-5852-A471-29C87D5C1D0F'),
}

model GetModifyBEClusterInquiryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetModifyBEClusterInquiryResponseBody(name='body'),
}

/**
 * @summary Queries the pricing for changing the specifications of a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request GetModifyBEClusterInquiryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetModifyBEClusterInquiryResponse
 */
async function getModifyBEClusterInquiryWithOptions(request: GetModifyBEClusterInquiryRequest, runtime: Util.RuntimeOptions): GetModifyBEClusterInquiryResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetModifyBEClusterInquiry',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the pricing for changing the specifications of a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request GetModifyBEClusterInquiryRequest
 * @return GetModifyBEClusterInquiryResponse
 */
async function getModifyBEClusterInquiry(request: GetModifyBEClusterInquiryRequest): GetModifyBEClusterInquiryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getModifyBEClusterInquiryWithOptions(request, runtime);
}

model ModifyBEClusterAttributeRequest {
  DBClusterId?: string(name='DBClusterId', description='This parameter is required.', example='selectdb-xxxb9f2w-be'),
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='selectdb-cn-7213cjv****'),
  instanceAttributeType?: string(name='InstanceAttributeType', description='The attribute type of the instance. Set this parameter to DBInstanceDescription.

This parameter is required.', example='DBInstanceDescription'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  value?: string(name='Value', description='The new name of the cluster.

This parameter is required.', example='testdb'),
}

model ModifyBEClusterAttributeResponseBody = {
  requestId?: string(name='RequestId', example='58E21E11-90FF-50F8-A615-8DEB193676E0'),
}

model ModifyBEClusterAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyBEClusterAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the name of a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request ModifyBEClusterAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyBEClusterAttributeResponse
 */
async function modifyBEClusterAttributeWithOptions(request: ModifyBEClusterAttributeRequest, runtime: Util.RuntimeOptions): ModifyBEClusterAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.instanceAttributeType)) {
    query['InstanceAttributeType'] = request.instanceAttributeType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyBEClusterAttribute',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the name of a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request ModifyBEClusterAttributeRequest
 * @return ModifyBEClusterAttributeResponse
 */
async function modifyBEClusterAttribute(request: ModifyBEClusterAttributeRequest): ModifyBEClusterAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBEClusterAttributeWithOptions(request, runtime);
}

model ModifyDBClusterRequest {
  cacheSize?: string(name='CacheSize', description='The size of the reserved cache.', example='200'),
  DBClusterClass?: string(name='DBClusterClass', description='This parameter is required.', example='selectdb.2xlarge'),
  DBClusterId?: string(name='DBClusterId', description='This parameter is required.', example='selectdb-xxxb9f2w-be'),
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='selectdb-cn-7213cjv****'),
  engine?: string(name='Engine', description='The database engine of the instance. Set the value to selectdb.', example='selectdb'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBClusterResponseBody = {
  DBInstanceId?: string(name='DBInstanceId', description='代表资源一级ID的资源属性字段', example='selectdb-cn-7213cjv****'),
  data?: {
    DBClusterId?: string(name='DBClusterId', example='selectdb-cn-7213cjv****'),
    DBInstanceId?: string(name='DBInstanceId', example='selectdb-cn-7213cjv****'),
    orderId?: long(name='OrderId', example='219396937240838'),
  }(name='Data'),
  requestId?: string(name='RequestId', example='0BF61F90-ACED-55DF-A6FE-56714B2BFCF6'),
}

model ModifyDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterResponseBody(name='body'),
}

/**
 * @summary 集群变配
 *
 * @param request ModifyDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterResponse
 */
async function modifyDBClusterWithOptions(request: ModifyDBClusterRequest, runtime: Util.RuntimeOptions): ModifyDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cacheSize)) {
    query['CacheSize'] = request.cacheSize;
  }
  if (!Util.isUnset(request.DBClusterClass)) {
    query['DBClusterClass'] = request.DBClusterClass;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.engine)) {
    query['Engine'] = request.engine;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBCluster',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 集群变配
 *
 * @param request ModifyDBClusterRequest
 * @return ModifyDBClusterResponse
 */
async function modifyDBCluster(request: ModifyDBClusterRequest): ModifyDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterWithOptions(request, runtime);
}

model ModifyDBClusterConfigRequest {
  configKey?: string(name='ConfigKey', description='This parameter is required.', example='be.conf'),
  DBClusterId?: string(name='DBClusterId', description='This parameter is required.', example='selectdb-cn-7213c8yvv09-be'),
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='selectdb-xxxd8a5h60y'),
  parallelOperation?: boolean(name='ParallelOperation', description='Specifies whether to perform parallel operations on the cluster node.', example='false'),
  parameters?: string(name='Parameters', description='This parameter is required.', example='[{\\\\"name\\\\":\\\\"param1\\\\",\\\\"value\\\\":\\\\"1234577777\\\\"},{\\\\"name\\\\":\\\\"param2\\\\",\\\\"value\\\\":\\\\"${yyyyMMdd}\\\\"}]'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  switchTimeMode?: string(name='SwitchTimeMode', example='1'),
}

model ModifyDBClusterConfigResponseBody = {
  accessDeniedDetail?: string(name='AccessDeniedDetail', example='failed'),
  data?: {
    dbClusterId?: string(name='DbClusterId', example='selectdb-cn-wny3li00g02-be'),
    dbInstanceId?: string(name='DbInstanceId', example='6585'),
    dbInstanceName?: string(name='DbInstanceName', example='selectdb-cn-wny3li00g02'),
    taskId?: int32(name='TaskId', example='107878719'),
  }(name='Data'),
  dynamicCode?: string(name='DynamicCode', description='The dynamic code. This parameter is not returned.', example='0'),
  dynamicMessage?: string(name='DynamicMessage', description='The dynamic message. This parameter is not returned.', example='An error occurred while processing your request.'),
  requestId?: string(name='RequestId', example='BC854513-E85E-54F3-9842-B9CCD3308CDD'),
}

model ModifyDBClusterConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBClusterConfigResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request ModifyDBClusterConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBClusterConfigResponse
 */
async function modifyDBClusterConfigWithOptions(request: ModifyDBClusterConfigRequest, runtime: Util.RuntimeOptions): ModifyDBClusterConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.configKey)) {
    query['ConfigKey'] = request.configKey;
  }
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.parallelOperation)) {
    query['ParallelOperation'] = request.parallelOperation;
  }
  if (!Util.isUnset(request.parameters)) {
    query['Parameters'] = request.parameters;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.switchTimeMode)) {
    query['SwitchTimeMode'] = request.switchTimeMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBClusterConfig',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the configurations of a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request ModifyDBClusterConfigRequest
 * @return ModifyDBClusterConfigResponse
 */
async function modifyDBClusterConfig(request: ModifyDBClusterConfigRequest): ModifyDBClusterConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBClusterConfigWithOptions(request, runtime);
}

model ModifyDBInstanceAttributeRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  instanceAttributeType?: string(name='InstanceAttributeType', description='The instance parameter to be modified. Valid values:

*   **MaintainTime**: Modify the maintenance window of the instance in the hh:mm-hh:mm format.
*   **DBInstanceDescription**: Modify the description of the instance.

This parameter is required.', example='DBInstanceDescription'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  value?: string(name='Value', description='The new value of the instance parameter to be modified. Examples:

*   If InstanceAttributeType is set to MaintainTime, you can set Value to 00:00-06:00.
*   If InstanceAttributeType is set to DBInstanceDescription, you can set Value to testdb.

This parameter is required.', example='testdb01'),
}

model ModifyDBInstanceAttributeResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2DB29DEE-52E4-57EE-BF68-2C95C20E6658'),
}

model ModifyDBInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDBInstanceAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the maintenance window or description of an ApsaraDB for SelectDB instance.
 *
 * @param request ModifyDBInstanceAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDBInstanceAttributeResponse
 */
async function modifyDBInstanceAttributeWithOptions(request: ModifyDBInstanceAttributeRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.instanceAttributeType)) {
    query['InstanceAttributeType'] = request.instanceAttributeType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDBInstanceAttribute',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the maintenance window or description of an ApsaraDB for SelectDB instance.
 *
 * @param request ModifyDBInstanceAttributeRequest
 * @return ModifyDBInstanceAttributeResponse
 */
async function modifyDBInstanceAttribute(request: ModifyDBInstanceAttributeRequest): ModifyDBInstanceAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceAttributeWithOptions(request, runtime);
}

model ModifyElasticRuleRequest {
  clusterClass?: string(name='ClusterClass', description='The rule for computing resources of the required cluster.', example='selectdb.2xlarge'),
  clusterId?: string(name='ClusterId', description='The cluster ID.

This parameter is required.', example='selectdb-cn-nwy3jv1oa02-be'),
  dbInstanceId?: string(name='DbInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  elasticRuleStartTime?: string(name='ElasticRuleStartTime', description='The time when you want to execute the scheduled scaling rule.', example='00:00'),
  executionPeriod?: string(name='ExecutionPeriod', description='The execution cycle.

Valid value:

*   Day', example='Day'),
  product?: string(name='Product', description='The cloud service.', example='selectdb'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ruleId?: long(name='RuleId', description='The rule ID.

This parameter is required.', example='5467'),
}

model ModifyElasticRuleResponseBody = {
  data?: {
    clusterClass?: string(name='ClusterClass', description='The rule for computing resources of the required cluster.', example='selectdb.2xlarge'),
    clusterId?: string(name='ClusterId', description='The cluster ID.', example='selectdb-cn-zpr3if5wq03-be'),
    dbInstanceId?: string(name='DbInstanceId', description='The instance ID.', example='selectdb-cn-7213cjv****'),
    elasticRuleStartTime?: string(name='ElasticRuleStartTime', description='The time when the scheduled scaling rule is executed.', example='00:00'),
    executionPeriod?: string(name='ExecutionPeriod', description='The execution cycle.

Valid value:

*   Day', example='Day'),
    ruleId?: long(name='RuleId', description='The rule ID.', example='29252'),
  }(name='Data', description='The data returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='5ED62C81-9948-5612-81E1-EA3853752306'),
}

model ModifyElasticRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyElasticRuleResponseBody(name='body'),
}

/**
 * @summary Modifies a scheduled scaling rule.
 *
 * @param request ModifyElasticRuleRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyElasticRuleResponse
 */
async function modifyElasticRuleWithOptions(request: ModifyElasticRuleRequest, runtime: Util.RuntimeOptions): ModifyElasticRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterClass)) {
    query['ClusterClass'] = request.clusterClass;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.dbInstanceId)) {
    query['DbInstanceId'] = request.dbInstanceId;
  }
  if (!Util.isUnset(request.elasticRuleStartTime)) {
    query['ElasticRuleStartTime'] = request.elasticRuleStartTime;
  }
  if (!Util.isUnset(request.executionPeriod)) {
    query['ExecutionPeriod'] = request.executionPeriod;
  }
  if (!Util.isUnset(request.product)) {
    query['Product'] = request.product;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.ruleId)) {
    query['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyElasticRule',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies a scheduled scaling rule.
 *
 * @param request ModifyElasticRuleRequest
 * @return ModifyElasticRuleResponse
 */
async function modifyElasticRule(request: ModifyElasticRuleRequest): ModifyElasticRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyElasticRuleWithOptions(request, runtime);
}

model ModifySecurityIPListRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  groupName?: string(name='GroupName', description='The name of the whitelist. Default value: **Default**.

This parameter is required.', example='default'),
  modifyMode?: string(name='ModifyMode', description='The mode in which you want to modify the whitelist. Valid values:

*   **0**: overwrites the IP addresses in the whitelist.
*   **1**: adds IP addresses to the whitelist.
*   **2**: removes IP addresses from the whitelist.

This parameter is required.', example='0'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityIPList?: string(name='SecurityIPList', description='The IP addresses in the whitelist of the instance. Separate multiple IP addresses with commas (,).

This parameter is required.', example='127.0.XX.XX,127.2.XX.XX'),
}

model ModifySecurityIPListResponseBody = {
  DBInstanceName?: string(name='DBInstanceName', description='The name of the instance.'),
  groupName?: string(name='GroupName', description='The name of the whitelist.', example='group1'),
  groupTag?: string(name='GroupTag', description='The tag of the whitelist.', example='grouptag'),
  requestId?: string(name='RequestId', description='The request ID.', example='195F64C2-8F11-532B-A436-FC08A221D756'),
  securityIPList?: string(name='SecurityIPList', description='The IP addresses in the whitelist of the instance. Multiple IP addresses are separated by commas (,).', example='127.0.XX.XX,127.2.XX.XX'),
  securityIPType?: string(name='SecurityIPType', description='The IP address type.', example='ipv4'),
  taskId?: long(name='TaskId', description='The task ID.', example='479095561'),
  whitelistNetType?: string(name='WhitelistNetType', description='The network type of the whitelist.', example='mix'),
}

model ModifySecurityIPListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifySecurityIPListResponseBody(name='body'),
}

/**
 * @summary Modifies the IP addresses in a whitelist of an ApsaraDB for SelectDB instance.
 *
 * @param request ModifySecurityIPListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifySecurityIPListResponse
 */
async function modifySecurityIPListWithOptions(request: ModifySecurityIPListRequest, runtime: Util.RuntimeOptions): ModifySecurityIPListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.modifyMode)) {
    query['ModifyMode'] = request.modifyMode;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.securityIPList)) {
    query['SecurityIPList'] = request.securityIPList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySecurityIPList',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the IP addresses in a whitelist of an ApsaraDB for SelectDB instance.
 *
 * @param request ModifySecurityIPListRequest
 * @return ModifySecurityIPListResponse
 */
async function modifySecurityIPList(request: ModifySecurityIPListRequest): ModifySecurityIPListResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySecurityIPListWithOptions(request, runtime);
}

model ReleaseInstancePublicConnectionRequest {
  connectionString?: string(name='ConnectionString', description='The connection string of the instance.

This parameter is required.', example='selectdb-cn-7213c8y****-public.selectdbfe.pre.rds.aliyuncs.com'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ReleaseInstancePublicConnectionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4773E4EC-025D-509F-AEA9-D53123FDFB0F'),
}

model ReleaseInstancePublicConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseInstancePublicConnectionResponseBody(name='body'),
}

/**
 * @summary Releases the public endpoint of an ApsaraDB for SelectDB instance.
 *
 * @param request ReleaseInstancePublicConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseInstancePublicConnectionResponse
 */
async function releaseInstancePublicConnectionWithOptions(request: ReleaseInstancePublicConnectionRequest, runtime: Util.RuntimeOptions): ReleaseInstancePublicConnectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.connectionString)) {
    query['ConnectionString'] = request.connectionString;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseInstancePublicConnection',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Releases the public endpoint of an ApsaraDB for SelectDB instance.
 *
 * @param request ReleaseInstancePublicConnectionRequest
 * @return ReleaseInstancePublicConnectionResponse
 */
async function releaseInstancePublicConnection(request: ReleaseInstancePublicConnectionRequest): ReleaseInstancePublicConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseInstancePublicConnectionWithOptions(request, runtime);
}

model ResetAccountPasswordRequest {
  accountName?: string(name='AccountName', description='The database account of the instance.

This parameter is required.', example='admin'),
  accountPassword?: string(name='AccountPassword', description='The password of the database account. Requirements:

*   The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
*   The following special characters can be used: ! @ # $ % ^ & \\\\* ( ) _ + - =
*   The password must be 8 to 32 characters in length.

This parameter is required.', example='a1b2c3d4@'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ResetAccountPasswordResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='58E21E11-90FF-50F8-A615-8DEB193676E0'),
}

model ResetAccountPasswordResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetAccountPasswordResponseBody(name='body'),
}

/**
 * @summary Resets the password of an account for an ApsaraDB for SelectDB instance.
 *
 * @param request ResetAccountPasswordRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPasswordWithOptions(request: ResetAccountPasswordRequest, runtime: Util.RuntimeOptions): ResetAccountPasswordResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetAccountPassword',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Resets the password of an account for an ApsaraDB for SelectDB instance.
 *
 * @param request ResetAccountPasswordRequest
 * @return ResetAccountPasswordResponse
 */
async function resetAccountPassword(request: ResetAccountPasswordRequest): ResetAccountPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetAccountPasswordWithOptions(request, runtime);
}

model RestartDBClusterRequest {
  DBClusterId?: string(name='DBClusterId', description='The cluster ID.

This parameter is required.', example='selectdb-cn-7213c8yvv09-be'),
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  parallelOperation?: boolean(name='ParallelOperation', description='Specifies whether to perform parallel operations on the cluster node.', example='false'),
  regionId?: string(name='RegionId', description='The region ID.

This parameter is required.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-4690g37929****'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model RestartDBClusterResponseBody = {
  data?: {
    DBClusterId?: string(name='DBClusterId', description='The cluster ID.', example='selectdb-cn-7213c8y****-be'),
    DBInstanceId?: string(name='DBInstanceId', description='The instance ID.', example='selectdb-cn-7213cjv****'),
  }(name='Data', description='The information returned.'),
  requestId?: string(name='RequestId', description='The request ID.', example='BD0D0B17-C145-5B91-BFC2-6791927EE973'),
}

model RestartDBClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RestartDBClusterResponseBody(name='body'),
}

/**
 * @summary Restarts a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request RestartDBClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RestartDBClusterResponse
 */
async function restartDBClusterWithOptions(request: RestartDBClusterRequest, runtime: Util.RuntimeOptions): RestartDBClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.parallelOperation)) {
    query['ParallelOperation'] = request.parallelOperation;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    body['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RestartDBCluster',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Restarts a cluster in an ApsaraDB for SelectDB instance.
 *
 * @param request RestartDBClusterRequest
 * @return RestartDBClusterResponse
 */
async function restartDBCluster(request: RestartDBClusterRequest): RestartDBClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return restartDBClusterWithOptions(request, runtime);
}

model StartBEClusterRequest {
  DBClusterId?: string(name='DBClusterId', description='This parameter is required.', example='selectdb-cn-7213c8yvv09-be'),
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model StartBEClusterResponseBody = {
  requestId?: string(name='RequestId', example='F203FA74-3041-589F-BE66-E570793A0C91'),
}

model StartBEClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartBEClusterResponseBody(name='body'),
}

/**
 * @summary 暂停后恢复集群
 *
 * @param request StartBEClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartBEClusterResponse
 */
async function startBEClusterWithOptions(request: StartBEClusterRequest, runtime: Util.RuntimeOptions): StartBEClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartBECluster',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 暂停后恢复集群
 *
 * @param request StartBEClusterRequest
 * @return StartBEClusterResponse
 */
async function startBECluster(request: StartBEClusterRequest): StartBEClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return startBEClusterWithOptions(request, runtime);
}

model StopBEClusterRequest {
  DBClusterId?: string(name='DBClusterId', description='This parameter is required.', example='selectdb-cn-7213cjv****'),
  DBInstanceId?: string(name='DBInstanceId', description='This parameter is required.', example='selectdb-cn-7213cjv****'),
  regionId?: string(name='RegionId', description='This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model StopBEClusterResponseBody = {
  requestId?: string(name='RequestId', example='BC854513-E85E-54F3-9842-B9CCD3308CDD'),
}

model StopBEClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopBEClusterResponseBody(name='body'),
}

/**
 * @summary 暂停BE集群
 *
 * @param request StopBEClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopBEClusterResponse
 */
async function stopBEClusterWithOptions(request: StopBEClusterRequest, runtime: Util.RuntimeOptions): StopBEClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBClusterId)) {
    query['DBClusterId'] = request.DBClusterId;
  }
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopBECluster',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 暂停BE集群
 *
 * @param request StopBEClusterRequest
 * @return StopBEClusterResponse
 */
async function stopBECluster(request: StopBEClusterRequest): StopBEClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopBEClusterWithOptions(request, runtime);
}

model UpgradeDBInstanceEngineVersionRequest {
  DBInstanceId?: string(name='DBInstanceId', description='The instance ID.

This parameter is required.', example='selectdb-cn-7213cjv****'),
  engineVersion?: string(name='EngineVersion', description='The database engine version of the instance.

This parameter is required.', example='2.4'),
  parallelOperation?: boolean(name='ParallelOperation'),
  regionId?: string(name='RegionId', description='The region ID of the instance.

This parameter is required.', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchTimeMode?: string(name='SwitchTimeMode', description='The update mode. If you do not specify this parameter, the system immediately updates the database engine version. If you set this parameter to 1, the system updates the database engine version during the maintenance window.', example='1'),
}

model UpgradeDBInstanceEngineVersionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4773E4EC-025D-509F-AEA9-D53123FDFB0F'),
}

model UpgradeDBInstanceEngineVersionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpgradeDBInstanceEngineVersionResponseBody(name='body'),
}

/**
 * @summary Updates the database engine version of an ApsaraDB for SelectDB instance.
 *
 * @param request UpgradeDBInstanceEngineVersionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpgradeDBInstanceEngineVersionResponse
 */
async function upgradeDBInstanceEngineVersionWithOptions(request: UpgradeDBInstanceEngineVersionRequest, runtime: Util.RuntimeOptions): UpgradeDBInstanceEngineVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.DBInstanceId)) {
    query['DBInstanceId'] = request.DBInstanceId;
  }
  if (!Util.isUnset(request.engineVersion)) {
    query['EngineVersion'] = request.engineVersion;
  }
  if (!Util.isUnset(request.parallelOperation)) {
    query['ParallelOperation'] = request.parallelOperation;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.switchTimeMode)) {
    query['SwitchTimeMode'] = request.switchTimeMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeDBInstanceEngineVersion',
    version = '2023-05-22',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the database engine version of an ApsaraDB for SelectDB instance.
 *
 * @param request UpgradeDBInstanceEngineVersionRequest
 * @return UpgradeDBInstanceEngineVersionResponse
 */
async function upgradeDBInstanceEngineVersion(request: UpgradeDBInstanceEngineVersionRequest): UpgradeDBInstanceEngineVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeDBInstanceEngineVersionWithOptions(request, runtime);
}

